Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes error: Correctly sets YouTube consent cookie #524

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexeichhorn
Copy link

Hey,
Great work with your repo. I've seen that YouTube made some changes recently that make XCDYouTubeKit fail in many regions. The issue was "discussed" in #523.
I implemented the same solution as in youtube-dl commit 14f29f. It basically has to set a "consent-cookie" so YouTube sees you agree with their terms and conditions, cookie rules or whatever.

Would be happy to hear your feedback

@Praveen-Balpande
Copy link

@ekincelik Still it is not working with some urls and giving me error with reason string "Video unavailable". Please check it.

Domain: XCDYouTubeVideoErrorDomain
Code: -2

Below Url is not working
https://www.youtube.com/watch?v=J6R4u8jSkh4

@alexeichhorn
Copy link
Author

@ekincelik Still it is not working with some urls and giving me error with reason string "Video unavailable". Please check it.

Domain: XCDYouTubeVideoErrorDomain
Code: -2

Below Url is not working
https://www.youtube.com/watch?v=J6R4u8jSkh4

Works for me with my pull request

@niklaskorz
Copy link

Works, thanks!

@Praveen-Balpande
Copy link

I had downloaded the code from alexeichhorn:fix/youtube-consent branch and added the required XCDYoutubeKit folder into project, because there is no new pod version available for this fix.

I run the project on real device and observed that https://www.youtube.com/watch?v=J6R4u8jSkh4 url gives me same error video unavailable.

Am I doing anything wrong here, how it’s working for u and not for me. Please suggest we depends on this lib and in a release phase. Please advise.

@alexeichhorn
Copy link
Author

I tested your video using the demo application in the repository, which worked, and used SwiftPM to integrate the framework in my application where I haven't tested your video, but a lot of others.
There's a chance this problem is region based, so maybe try to use a VPN to test some other regions. I myself tested it in Switzerland.

@ekincelik
Copy link

hi @Praveen-Balpande
I used alexeichhorn:fix/youtube-consent branch too. Your video is working for me.
You can check response in handleConnectionSuccessWithData method on XCDYouTubeVideoOperation.m class in order to understand what the problem is.

@jyotiglocalview
Copy link

Hi everyone,

I am getting this error while playing video id "E_lByLdKeKY"

2021-05-13 16:39:53.974689+0530 Quizzwizz[1362:383440] [XCDYouTubeKit] Failed to decode response from https://www.youtube.com/get_video_info?el=embedded&hl=en&ps=default&video_id=E_lByLdKeKY (response.textEncodingName = utf-8, data.length = 0)
2021-05-13 16:39:53.975118+0530 Quizzwizz[1362:383440] [XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -3.)
Domain: XCDYouTubeVideoErrorDomain
Code: -3
User Info: {
}
Couldn't get the video from video id

please note the video works on simulator but giving error on device. please help as we are about to release our app tomorrow.

@jsawko
Copy link

jsawko commented May 13, 2021

It works for me, thanks a lot
Jarek

@jyotiglocalview
Copy link

It works for me, thanks a lot
Jarek

please help me also...in my app most of the videos are not getting played..:(

@jsawko
Copy link

jsawko commented May 13, 2021

It works for me, thanks a lot
Jarek

please help me also...in my app most of the videos are not getting played..:(

Hi
I have added new lines from
893401b

to the file:
XCDYouTubeKit/XCDYouTubeVideoOperation.m

Hope that helps
Best
Jarek

@sherwinzadeh
Copy link

Can you add the fix from other pull-requests:
NSDictionary *query = @{ @"video_id": self.videoIdentifier, @"hl": self.languageIdentifier, @"el": eventLabel, @"ps": @"default", @"html5" : @"1" };

@alexeichhorn
Copy link
Author

@sherwinzadeh I've merged both pull requests in the master branch of my fork. I use it myself in SwiftPM for my own project.

@jsawko
Copy link

jsawko commented Jul 13, 2021

@sherwinzadeh I've merged both pull requests in the master branch of my fork. I use it myself in SwiftPM for my own project.

Hi, can you please write what is the correct pod file entry for your fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants